package com.api.service.impl;

import com.api.dao.UsersDao;
import com.api.entity.Users;
import com.api.entity.UsersDto;
import com.api.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersDao usersDao;

    public Users login(Users user) {
        return usersDao.login(user);
    }

    public int againpwd(String un) {
        return usersDao.againpwd(un);
    }

    public int updateLockUsertrue(String un) {
        return usersDao.updateLockUsertrue(un);
    }

    public int updateLockUserfalse(String un) {
        return usersDao.updateLockUserfalse(un);
    }

    public int updateState(String uid) {
        return usersDao.updateState(uid);
    }

    public List<Users> findAllBySomeOrder(UsersDto usersDto) {
        return usersDao.findAllBySomeOrder(usersDto);
    }

    public int updateUsersSomeOrderByid(Users user) {
        return usersDao.updateUsersSomeOrderByid(user);
    }

    public int addUsers(Users user) {
        return usersDao.addUsers(user);
    }

    public int updateUsersTimeById(String id) {
        return usersDao.updateUsersTimeById(id);
    }

    public Users findAllByUname(String name) {
        // TODO Auto-generated method stub
        return usersDao.findAllByUname(name);
    }

    public Users findAllByUemal(String emal) {
        // TODO Auto-generated method stub
        return usersDao.findAllByUemal(emal);
    }

    public Users findAllByUnumber(String tel) {
        // TODO Auto-generated method stub
        return usersDao.findAllByUnumber(tel);
    }

    @Override
    public int resetPwd(String un, String pwd) {
        return usersDao.resetPwd(un, pwd);
    }

    @Override
    public int updateMac(String un, String macAddress) {
        return usersDao.updateMac(un, macAddress);
    }

	@Override
	public int resetMac(String un) {
		return usersDao.resetMac(un);
	}

    @Override
    public Users findUserByIdAndName(String userId, String userName) {
        return usersDao.findUserByIdAndName(userId,userName);
    }

}
